package com.fsl.springbootdesignpattern.b_factory.simple_factory;

/**
 * @author sj2
 * 简单工厂
 */
public class SimpleFactory {

    public Car getCar(String name){
        switch (name)
        {
            case "Audi":
                return new Audi();
            case "Bmw":
                return new Bmw();
            case "Benz":
                return new Benz();
            default:
                System.out.println("本车辆暂停生产了");
                return null;
        }
    }
}
